<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserWechatsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_wechats', function (Blueprint $table) {
            $table->increments('id');
            $table->integer("user_id")->nullable()->comment("用户id"); //外键
            $table->string('unionid',40)->nullable()->comment('微信的unionid');
            $table->string('openid',40)->nullable()->comment('微信的openid');
            $table->string('appid',40)->nullable()->comment('微信的appid');
            $table->string('api_token', 100)->nullable()->comment('用户登录令牌');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_wechats');
    }
}
